<template>
	<view style="position: relative;">
		<image :src="imageUrl" mode="widthFix" style="width: 750rpx;" @load="handleImageLoad" v-if="imageUrl" />
		
	</view>
</template>

<script setup>
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app';
	import {
		ref,
		onMounted,

	} from 'vue';

	// 定义响应式变量  
	const imageUrl = ref(''); // 图片地址  
	const imageLoaded = ref(false); // 图片加载状态  

	// 使用 onMounted 钩子设置图片的 URL  
	const id = ref("")
	onLoad((options) => {

		id.value = options.id
		console.log(options.id, "1", imageUrl)
		if (id.value === "1") {
			//长寿肠寿
			uni.setNavigationBarTitle({
				title:"“长寿”真正的秘诀——“肠寿”"
				});
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%22%E9%95%BF%E5%AF%BF%22%E7%9C%9F%E6%AD%A3%E7%9A%84%E7%A7%98%E8%AF%80---%22%E8%82%A0%E5%AF%BF%2220241201/%E2%80%9C%E9%95%BF%E5%AF%BF%E2%80%9D%E7%9C%9F%E6%AD%A3%E7%9A%84%E7%A7%98%E8%AF%80%E2%80%94%E2%80%94%E2%80%9C%E8%82%A0%E5%AF%BF%E2%80%9D_01-1732985597.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1732985539%3B4886585599&q-key-time=1732985539%3B4886585599&q-header-list=host&q-url-param-list=&q-signature=2605f99e6450b7b0920421bd5677f016cec49ea5"
		} else if (id.value === "2") {
			//寒露气节的中医养生和食疗
			uni.setNavigationBarTitle({
				title:"寒露节气的中医养生和食疗"
				});
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%AF%92%E9%9C%B2%E6%B0%94%E8%8A%82%E7%9A%84%E4%B8%AD%E5%8C%BB%E5%85%BB%E7%94%9F%E5%92%8C%E9%A3%9F%E7%96%9720241201/%E5%AF%92%E9%9C%B2%E8%8A%82%E6%B0%94%E7%9A%84%E4%B8%AD%E5%8C%BB%E5%85%BB%E7%94%9F%E5%92%8C%E9%A3%9F%E7%96%97_01-1732985678.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1732985619%3B4886585679&q-key-time=1732985619%3B4886585679&q-header-list=host&q-url-param-list=&q-signature=c89f19264709ca45b9193326730f7de3f1676258"
		} else if (id.value === "3") {
			uni.setNavigationBarTitle({
				title:"秋季养生的误区与建议"
				});
			//秋季养生的误区
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E7%A7%8B%E5%AD%A3%E5%85%BB%E7%94%9F%E7%9A%84%E8%AF%AF%E5%8C%BA20241201/%E7%A7%8B%E5%AD%A3%E5%85%BB%E7%94%9F%E7%9A%84%E8%AF%AF%E5%8C%BA%E4%B8%8E%E5%BB%BA%E8%AE%AE_01-1732985749.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1732985693%3B4886585753&q-key-time=1732985693%3B4886585753&q-header-list=host&q-url-param-list=&q-signature=bf8dadc92e052e847059dcf30fecc6c8b28e6138"
		} else if (id.value === "4") {
			//权威发布成人要睡几个小时
			uni.setNavigationBarTitle({
				title:"权威研究发布！成人一天需要睡几个小时？"
				});
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E6%9D%83%E5%A8%81%E5%8F%91%E5%B8%83%E6%88%90%E4%BA%BA%E7%9D%A1%E8%A7%89%E5%87%A0%E4%B8%AA%E5%B0%8F%E6%97%B620241201/%E6%9D%83%E5%A8%81%E7%A0%94%E7%A9%B6%E5%8F%91%E5%B8%83%EF%BC%81%E6%88%90%E4%BA%BA%E4%B8%80%E5%A4%A9%E9%9C%80%E8%A6%81%E7%9D%A1%E5%87%A0%E4%B8%AA%E5%B0%8F%E6%97%B6%EF%BC%9F_01-1732985884.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1732985826%3B4886585886&q-key-time=1732985826%3B4886585886&q-header-list=host&q-url-param-list=&q-signature=9ac9b8c0c0c69dce86a8c794ce3658d22bd53760"
		} else if (id.value === "5") {
			uni.setNavigationBarTitle({
				title:"2024年诺贝尔生理学或医学奖揭晓 揭开基因调控之谜！"
				});
			//诺贝尔生理学奖励
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E6%9D%83%E5%A8%81%E5%8F%91%E5%B8%83%E6%88%90%E4%BA%BA%E7%9D%A1%E8%A7%89%E5%87%A0%E4%B8%AA%E5%B0%8F%E6%97%B620241201/2024%E5%B9%B4%E8%AF%BA%E8%B4%9D%E5%B0%94%E7%94%9F%E7%90%86%E5%AD%A6%E6%88%96%E5%8C%BB%E5%AD%A6%E5%A5%96%E6%8F%AD%E6%99%93%20%E6%8F%AD%E5%BC%80%E5%9F%BA%E5%9B%A0%E8%B0%83%E6%8E%A7%E4%B9%8B%E8%B0%9C%EF%BC%81_01-1732985935.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1732985878%3B4886585938&q-key-time=1732985878%3B4886585938&q-header-list=host&q-url-param-list=&q-signature=54ecd375fd67d128db6b0011955f7cc16eb95aa4"
		} else if (id.value === "6") {
			//全球首个针电量记忆之光
			uni.setNavigationBarTitle({
				title:"全球首个针点亮记忆之光！全球首个阿尔茨海默病靶向药在我国获批"
				});
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%85%A8%E7%90%83%E9%A6%96%E4%B8%AA%E9%92%88%E4%BA%AE%E7%82%B9%E8%AE%B0%E5%BF%8620241201/%E5%85%A8%E7%90%83%E9%A6%96%E6%AC%BE%E6%B8%90%E5%86%BB%E7%97%87%E5%9F%BA%E5%9B%A0%E7%96%97%E6%B3%95ASO%E5%88%9B%E6%96%B0%E8%8D%AF%E5%9C%A8%E4%B8%AD%E5%9B%BD%E8%8E%B7%E6%89%B9%E4%B8%8A%E5%B8%82%EF%BC%81_01-1732986081.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1732986023%3B4886586083&q-key-time=1732986023%3B4886586083&q-header-list=host&q-url-param-list=&q-signature=260a11e597a1057d401d6ce5c7137987ebece3b7"
		} else if (id.value === "7") {
			uni.setNavigationBarTitle({
				title:"全球首款渐冻症基因疗法ASO创新药在中国获批上市！"
				});
			//全球收款
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%85%A8%E7%90%83%E9%A6%96%E4%B8%AA%E9%92%88%E4%BA%AE%E7%82%B9%E8%AE%B0%E5%BF%8620241201/%E5%85%A8%E7%90%83%E9%A6%96%E6%AC%BE%E6%B8%90%E5%86%BB%E7%97%87%E5%9F%BA%E5%9B%A0%E7%96%97%E6%B3%95ASO%E5%88%9B%E6%96%B0%E8%8D%AF%E5%9C%A8%E4%B8%AD%E5%9B%BD%E8%8E%B7%E6%89%B9%E4%B8%8A%E5%B8%82%EF%BC%81_01-1732986182.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1732986123%3B4886586183&q-key-time=1732986123%3B4886586183&q-header-list=host&q-url-param-list=&q-signature=0152fb912dba298a84ba5c04638a8fa5c1ac5d67"
		}else if (id.value === "8") {
			uni.setNavigationBarTitle({
				title:"胰岛素无针注射时代来了，既然无针，那是不是比吃药还好了？"
				});
			//胰岛素
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E5%85%A8%E7%90%83%E9%A6%96%E4%B8%AA%E9%92%88%E4%BA%AE%E7%82%B9%E8%AE%B0%E5%BF%8620241201/%E8%83%B0%E5%B2%9B%E7%B4%A0%E6%97%A0%E9%92%88%E6%B3%A8%E5%B0%84%E6%97%B6%E4%BB%A3%E6%9D%A5%E4%BA%86%EF%BC%8C%E6%97%A2%E7%84%B6%E6%97%A0%E9%92%88%EF%BC%8C%E9%82%A3%E6%98%AF%E4%B8%8D%E6%98%AF%E6%AF%94%E5%90%83%E8%8D%AF%E8%BF%98%E5%A5%BD%E4%BA%86%EF%BC%9F_01-1732986236.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1732986177%3B4886586237&q-key-time=1732986177%3B4886586237&q-header-list=host&q-url-param-list=&q-signature=212fde817dd79c5e5b94de815920b91cf60c19f4"
		}
	})
	onMounted(() => {
		
		
	})
	// 定义处理图片加载的方法  
	const handleImageLoad = () => {
		imageLoaded.value = true;
		// 修改加载状态为已加载  
		console.log('Image loaded successfully');
	};
	const goto = () => {
		uni.navigateTo({
			url: "/pages/invite/serveritem"
		})
	}
	const longPressHandler = () => {
        wx.scanCode({
              scanType: ['qrCode'],
              success: function(res) {
                console.log(res.result);
              }
            });
	}
</script>

<style scoped>

</style>